import { uniFetch } from './uni-fetch'

/**
 * 任务列表
 */
export const ToskList = (data) => {
  return uniFetch({
    method: 'GET',
    url: '/driver/tasks/list',
    data,
  })
}

/**
 * 任务详情 Copy
 */
export const ToskDetail = (jobId) => {
  return uniFetch({
    method: 'GET',
    url: '/driver/tasks/details/' + jobId,
  })
}

/**
 * 延迟提货
 */
export const taskDelay = (data) => {
  return uniFetch({
    method: 'PUT',
    url: '/driver/tasks/delay',
    data,
  })
}

/**
 * 提货
 */
export const takeDelivery = (data) => {
  return uniFetch({
    method: 'POST',
    url: '/driver/tasks/takeDelivery',
    data,
  })
}

/**
 * 上报异常
 */
export const reportException = (data) => {
  return uniFetch({
    method: 'POST',
    url: '/driver/tasks/reportException',
    data,
  })
}

/**
 * 交付
 */
export const deliver = (data) => {
  return uniFetch({
    method: 'POST',
    url: '/driver/tasks/deliver',
    data,
  })
}

/**
 * 回车登记
 */
export const truckRegistration = (data) => {
  return uniFetch({
    method: 'POST',
    url: '/driver/tasks/truckRegistration',
    data,
  })
}
